import { rcaNumberFormat } from './common.js'
import { commonTableOption } from './common.js'
export const tableOption = {
  ...commonTableOption,
  selection: true,
  height: 400,
  column: [{
    type: 'date',
    label: '计算周期',
    prop: 'calcTime',
    valueFormat: 'yyyy-MM-dd',
    searchSpan: 12,
    searchRange: true,
    search: true,
    slot: true
  }, {
    type: 'select',
    label: '运营商',
    props: {
      label: 'operatorsName',
      value: 'operators'
    },
    dicUrl: '/rca/swckclearrules/listoperators',
    search: true,
    prop: 'operators'
  }, {
    type: 'input',
    label: '数据来源',
    dicData: [{
      label: '系统计算',
      value: '1'
    }, {
      label: '人工添加',
      value: '2'
    }],
    prop: 'dataSource'
  }, {
    type: 'input',
    label: '应急纸票清分比例',
    prop: 'emergencyPaperTicket'
  }, {
    type: 'input',
    label: '退票清分比例',
    prop: 'returnTicket'
  }, {
    type: 'input',
    label: '人工协议清分比例（与其他运营商）',
    prop: 'agreeTicketClearProportionOther'
  }, {
    type: 'input',
    label: '人脸识别清分比例',
    prop: 'faceTicketClearProportion'
  }, {
    type: 'input',
    label: '人工协议清分比例（西安地铁）',
    prop: 'agreeTicketClearProportionSubway'
  }, {
    type: 'input',
    label: '计次票清分比例',
    prop: 'countTicket'
  }, {
    type: 'input',
    label: '定值纪念票清分比例',
    prop: 'constantValueTicket'
  }, {
    type: 'input',
    label: '使用状态',
    dicData: [{
      label: '使用中',
      value: '1'
    }, {
      label: '暂停使用',
      value: '2'
    }],
    prop: 'usedState'
  }, {
    label: '操作',
    prop: 'menu',
    slot: true
  },]
}

export const preivewTableOption = {
  ...commonTableOption,
  height: 400,
  column: [{
    type: 'select',
    label: '线路',
    prop: 'lineCode',
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: '/support/swparamline/dictsecondname',
  }, {
    type: 'input',
    label: '应急纸票清分比例',
    prop: 'emergencyPaperTicket'
  }, {
    type: 'input',
    label: '退票清分比例',
    prop: 'returnTicket'
  }, {
    type: 'input',
    label: '人工协议清分比例（与其他运营商）',
    prop: 'agreeTicketClearProportionOther'
  }, {
    type: 'input',
    label: '人脸识别清分比例',
    prop: 'faceTicketClearProportion'
  }, {
    type: 'input',
    label: '人工协议清分比例（西安地铁）',
    prop: 'agreeTicketClearProportionSubway'
  }, {
    type: 'input',
    label: '计次票清分比例',
    prop: 'countTicket'
  }, {
    type: 'input',
    label: '定值纪念票清分比例',
    prop: 'constantValueTicket'
  }]
}

export const tableOptionAdd = {
  border: true,
  index: true,
  align: "center",
  labelWidth: 160,
  submitBtn:false,
  emptyBtn:false,
  column: [{
      label: "开始时间",
      prop: "beginTime",
      type: "date",
      format: "yyyy-MM-dd",
      valueFormat: "yyyy-MM-dd",
      rules: [{
        required: true,
        message: "请选择开始时间",
        trigger: "blur"
      }]
    },{
      label: "结束时间",
      prop: "endTime",
      type: "date",
      format: "yyyy-MM-dd",
      valueFormat: "yyyy-MM-dd",
      rules: [{
        required: true,
        message: "请选择结束时间",
        trigger: "blur"
      }]
    }, {
      label: '运营商',
      prop: 'operators',
      type: 'select',
      props: {
        label: 'operatorsName',
        value: 'operators'
      },
      dicUrl: '/rca/swckclearrules/listoperators',
      rules: [{
        required: true,
        message: "请选择运营商",
        trigger: "blur"
      }]
    },{
      type: "input",
      precision: 2,
      label: "应急纸票清分比例",
      prop: "emergencyPaperTicket",
      rules: [{
        required: true,
        message: "请输入应急纸票清分比例",
        trigger: "blur"
      }]
    },{
      type: "input",
      precision: 2,
      label: "退票清分比例",
      prop: "returnTicket",
      rules: [{
        required: true,
        message: "请输入退票清分比例",
        trigger: "blur"
      }]
    },{
      type: "input",
      precision: 2,
      label: "日票清分比例",
      prop: "dayTicket",
      rules: [{
        required: true,
        message: "请输入日票清分比例",
        trigger: "blur"
      }]
    },{
      type: "input",
      precision: 2,
      label: "人工协议清分比例（与其他运营商）",
      prop: "agreeTicketClearProportionOther",
      rules: [{
        required: true,
        message: "请输入人工协议清分比例（与其他运营商）",
        trigger: "blur"
      }]
    },{
      type: "input",
      precision: 2,
      label: "人脸识别清分比例",
      prop: "faceTicketClearProportion",
      rules: [{
        required: true,
        message: "请输入人脸识别清分比例",
        trigger: "blur"
      }]
    },{
      type: "input",
      precision: 2,
      label: "人工协议清分比例（西安地铁）",
      prop: "agreeTicketClearProportionSubway",
      rules: [{
        required: true,
        message: "请输入人工协议清分比例（西安地铁）",
        trigger: "blur"
      }]
    },{
      type: "input",
      precision: 2,
      label: "计次票清分比例",
      prop: "countTicket",
      rules: [{
        required: true,
        message: "请输入计次票清分比例",
        trigger: "blur"
      }]
    },{
      type: "input",
      precision: 2,
      label: "定值纪念票清分比例",
      prop: "constantValueTicket",
      rules: [{
        required: true,
        message: "请输入定值纪念票清分比例",
        trigger: "blur"
      }]
    },{
      type: 'select',
      prop: 'usedState',
      label: '使用状态',
      dicData: [{
        label: '使用中',
        value: '1'
      }, {
        label: '暂停使用',
        value: '2'
      }],
      rules: [{
        required: true,
        message: "请选择使用状态",
        trigger: "blur"
      }]
    },
  ]
};

export const tableOptionAddDetail = {
  border: true,
  index: true,
  indexLabel: "序号",
  align: "center",
  column: [{
    type: 'select',
    label: '线路',
    prop: 'lineCode',
    slot: true,
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: '/support/swparamline/dictsecondname',
    width: 150,
    cell: true,
    rules: [{
      required: true,
      message: "请选择线路",
      trigger: "blur"
    }]
  }, {
    type: "input",
    precision: 2,
    label: '应急纸票清分比例',
    prop: 'emergencyPaperTicket',
    width: 150,
    cell: true,
    rules: [{
      required: true,
      message: "请输入应急纸票清分比例",
      trigger: "blur"
    }]
  }, {
    type: "input",
    precision: 2,
    label: '退票清分比例',
    prop: 'returnTicket',
    width: 150,
    cell: true,
    rules: [{
      required: true,
      message: "请输入退票清分比例",
      trigger: "blur"
    }]
  }, {
    type: "input",
    precision: 2,
    label: '日票清分比例',
    prop: 'dayTicket',
    width: 150,
    cell: true,
    rules: [{
      required: true,
      message: "请输入日票清分比例",
      trigger: "blur"
    }]
  }, {
    type: "input",
    precision: 2,
    label: '人工协议清分比例（与其他运营商）',
    prop: 'agreeTicketClearProportionOther',
    width: 150,
    cell: true,
    rules: [{
      required: true,
      message: "请输入人工协议清分比例",
      trigger: "blur"
    }]
  }, {
    type: "input",
    precision: 2,
    label: '人脸识别清分比例',
    prop: 'faceTicketClearProportion',
    width: 150,
    cell: true,
    rules: [{
      required: true,
      message: "请输入人脸识别清分比例",
      trigger: "blur"
    }]
  }, {
    type: "input",
    precision: 2,
    label: '人工协议清分比例（西安地铁）',
    prop: 'agreeTicketClearProportionSubway',
    width: 200,
    cell: true,
    rules: [{
      required: true,
      message: "请输入人工协议清分比例",
      trigger: "blur"
    }]
  }, {
    type: "input",
    precision: 2,
    label: '计次票清分比例',
    prop: 'countTicket',
    width: 150,
    cell: true,
    rules: [{
      required: true,
      message: "请输入计次票清分比例",
      trigger: "blur"
    }]
  }, {
    type: "input",
    precision: 2,
    label: '定值纪念票清分比例',
    prop: 'constantValueTicket',
    width: 150,
    cell: true,
    rules: [{
      required: true,
      message: "请输入定值纪念票清分比例",
      trigger: "blur"
    }]
  }]
};
